<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="FinalizeShipment.aspx.vb" Inherits="GTSWeb_Shipment_FinalizeShipment" title="GTS Frieght Management System"  MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
    <h3>Your Shipment has been successfully processed.</h3>
 
        <table width="100%">
            <tr>
                <td style="width: 109px">
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4"
            DataKeyNames="ReferenceNumber,ClientID,ClientBranchID,UserName" DataSourceID="ShipmentSource"
            ForeColor="#333333" GridLines="None" Height="50px" Width="100%">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <EditRowStyle BackColor="#999999" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <Fields>
                <asp:BoundField DataField="ReferenceNumber" HeaderText="ReferenceNumber" ReadOnly="True"
                    SortExpression="ReferenceNumber" />
                <asp:BoundField DataField="ShipmentDate" HeaderText="ShipmentDate" SortExpression="ShipmentDate" />
                <asp:TemplateField HeaderText="ClientID" SortExpression="ClientID" Visible="False">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ClientID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ClientID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ClientID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ClientBranchID" HeaderText="ClientBranchID" SortExpression="ClientBranchID"
                    Visible="False" />
                <asp:TemplateField HeaderText="CarrierID" SortExpression="CarrierID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server" BackColor="White" DataSourceID="carrierSource"
                            DataTextField="CarrierName" DataValueField="CarrierID" ForeColor="Black" SelectedValue='<%# Bind("CarrierID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="carrierSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="getCarrierByClientBranchId" TypeName="GTSSystem.BLL.Carrier">
                            <SelectParameters>
                                <asp:ProfileParameter Name="BranchID" PropertyName="BranchId" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("CarrierID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server" BackColor="White" DataSourceID="carrierSource"
                            DataTextField="CarrierName" DataValueField="CarrierID" Enabled="False" ForeColor="Black"
                            SelectedValue='<%# Bind("CarrierID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="carrierSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="getCarrierByClientBranchId" TypeName="GTSSystem.BLL.Carrier">
                            <SelectParameters>
                                <asp:ProfileParameter Name="BranchID" PropertyName="BranchId" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Weight" HeaderText="Weight" SortExpression="Weight" />
                <asp:TemplateField HeaderText="ServiceTypeID" SortExpression="ServiceTypeID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList2" runat="server" BackColor="White" DataSourceID="ServiceTypeSource"
                            DataTextField="ServiceTypeName" DataValueField="ServiceTypeID" ForeColor="Black"
                            SelectedValue='<%# Bind("ServiceTypeID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="ServiceTypeSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetServiceType" TypeName="GTSSystem.BLL.ServiceType"></asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ServiceTypeID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="DropDownList2" runat="server" BackColor="White" DataSourceID="ServiceTypeSource"
                            DataTextField="ServiceTypeName" DataValueField="ServiceTypeID" Enabled="False"
                            ForeColor="Black" SelectedValue='<%# Bind("ServiceTypeID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="ServiceTypeSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetServiceType" TypeName="GTSSystem.BLL.ServiceType"></asp:ObjectDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                <asp:BoundField DataField="GST" HeaderText="GST" SortExpression="GST" />
                <asp:BoundField DataField="PST" HeaderText="PST" SortExpression="PST" />
                <asp:BoundField DataField="HST" HeaderText="HST" SortExpression="HST" />
                <asp:BoundField DataField="Surcharge" HeaderText="Surcharge" SortExpression="Surcharge" />
                <asp:BoundField DataField="NrOfPieces" HeaderText="NrOfPieces" SortExpression="NrOfPieces" />
                <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName"
                    Visible="False" />
                <asp:TemplateField HeaderText="StatusID" SortExpression="StatusID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="StatusSource" DataTextField="StatusName"
                            DataValueField="StatusID" SelectedValue='<%# Bind("StatusID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="StatusSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("StatusID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="DropDownList3" runat="server" BackColor="White" DataSourceID="StatusSource"
                            DataTextField="StatusName" DataValueField="StatusID" Enabled="False" ForeColor="Black"
                            SelectedValue='<%# Bind("StatusID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="StatusSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ShipmentNumber" HeaderText="ShipmentNumber" SortExpression="ShipmentNumber" />
                <asp:BoundField DataField="OriginAddress" HeaderText="OriginAddress" SortExpression="OriginAddress" />
                <asp:TemplateField HeaderText="Origin" SortExpression="OriginID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="OriginSource" DataTextField="City"
                            DataValueField="RateLocationID" SelectedValue='<%# Bind("OriginID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="OriginSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetRateLocation" TypeName="GTSSystem.BLL.RateLocation">
                            <SelectParameters>
                                <asp:ProfileParameter Name="BranchID" PropertyName="BranchId" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("OriginID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="DropDownList4" runat="server" BackColor="White" DataSourceID="OriginSource"
                            DataTextField="City" DataValueField="RateLocationID" Enabled="False" ForeColor="Black"
                            SelectedValue='<%# Bind("OriginID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="OriginSource" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetRateLocation" TypeName="GTSSystem.BLL.RateLocation">
                            <SelectParameters>
                                <asp:ProfileParameter Name="BranchID" PropertyName="BranchId" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="OriginPostalCode" HeaderText="OriginPostalCode" SortExpression="OriginPostalCode" />
                <asp:BoundField DataField="DestinationAddress" HeaderText="DestinationAddress" SortExpression="DestinationAddress" />
                <asp:TemplateField HeaderText="Destination" SortExpression="DestinationID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList5" runat="server" DataSourceID="destinationSource"
                            DataTextField="City" DataValueField="RateLocationID" SelectedValue='<%# Bind("DestinationID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="destinationSource" runat="server" InsertMethod="AddRateLocation"
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetRateLocation"
                            TypeName="GTSSystem.BLL.RateLocation" UpdateMethod="UpdateRateLocation">
                            <UpdateParameters>
                                <asp:Parameter Name="RateLocationID" Type="Int32" />
                                <asp:Parameter Name="City" Type="String" />
                                <asp:Parameter Name="Province" Type="String" />
                                <asp:Parameter Name="Country" Type="String" />
                            </UpdateParameters>
                            <SelectParameters>
                                <asp:ProfileParameter Name="BranchID" PropertyName="Branchid" Type="Int32" />
                            </SelectParameters>
                            <InsertParameters>
                                <asp:Parameter Name="BranchID" Type="Int32" />
                                <asp:Parameter Name="City" Type="String" />
                                <asp:Parameter Name="Province" Type="String" />
                                <asp:Parameter Name="Country" Type="String" />
                            </InsertParameters>
                        </asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("DestinationID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="DropDownList5" runat="server" BackColor="White" DataSourceID="destinationSource"
                            DataTextField="City" DataValueField="RateLocationID" Enabled="False" ForeColor="Black"
                            SelectedValue='<%# Bind("DestinationID") %>'>
                        </asp:DropDownList><asp:ObjectDataSource ID="destinationSource" runat="server" InsertMethod="AddRateLocation"
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetRateLocation"
                            TypeName="GTSSystem.BLL.RateLocation" UpdateMethod="UpdateRateLocation">
                            <UpdateParameters>
                                <asp:Parameter Name="RateLocationID" Type="Int32" />
                                <asp:Parameter Name="City" Type="String" />
                                <asp:Parameter Name="Province" Type="String" />
                                <asp:Parameter Name="Country" Type="String" />
                            </UpdateParameters>
                            <SelectParameters>
                                <asp:ProfileParameter Name="BranchID" PropertyName="Branchid" Type="Int32" />
                            </SelectParameters>
                            <InsertParameters>
                                <asp:Parameter Name="BranchID" Type="Int32" />
                                <asp:Parameter Name="City" Type="String" />
                                <asp:Parameter Name="Province" Type="String" />
                                <asp:Parameter Name="Country" Type="String" />
                            </InsertParameters>
                        </asp:ObjectDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="DestinationPostalCode" HeaderText="DestinationPostalCode"
                    SortExpression="DestinationPostalCode" />
                <asp:BoundField DataField="Total" HeaderText="Total" SortExpression="Total" />
                <asp:BoundField DataField="SurchargeAmount" HeaderText="SurchargeAmount" SortExpression="SurchargeAmount" />
            </Fields>
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" Width="200px" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderTemplate>
                Shipment Details
            </HeaderTemplate>
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:DetailsView>
                </td>
                <td valign="top" style="width: 249px" >
                    <h4>Additional Tasks</h4>
                    <p>
                        <asp:LinkButton ID="lnkBOL" runat="server">Bill of Lading</asp:LinkButton>
                    </p>
                    <p>
                        <asp:LinkButton ID="lnkRO" runat="server">Routing Order</asp:LinkButton>&nbsp;</p>
                </td>
            </tr>
        </table>
    
    <p>
        <asp:Label ID="lblMessage" runat="server" Font-Bold="True" ForeColor="#3300FF"></asp:Label>&nbsp;</p>
    <p>
        <asp:ObjectDataSource ID="ShipmentSource" runat="server" InsertMethod="CreateShipment"
            OldValuesParameterFormatString="original_{0}" SelectMethod="getShipmentByReferencenumber"
            TypeName="GTSSystem.BLL.Shipment" UpdateMethod="UpdateShipment">
            <UpdateParameters>
                <asp:Parameter Name="ReferenceNumber" Type="Int32" />
                <asp:Parameter Name="Shipmentdate" Type="DateTime" />
                <asp:Parameter Name="ClientId" Type="Int32" />
                <asp:Parameter Name="ClientBranchid" Type="Int32" />
                <asp:Parameter Name="CarrierId" Type="Int32" />
                <asp:Parameter Name="Weight" Type="Double" />
                <asp:Parameter Name="OriginID" Type="Int32" />
                <asp:Parameter Name="OriginAddress" Type="String" />
                <asp:Parameter Name="OriginPostalCode" Type="String" />
                <asp:Parameter Name="DestinationID" Type="Int32" />
                <asp:Parameter Name="DestinationAddress" Type="String" />
                <asp:Parameter Name="DestinationPostalCode" Type="String" />
                <asp:Parameter Name="ServiceTypeId" Type="Int32" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="GST" Type="Double" />
                <asp:Parameter Name="PST" Type="Double" />
                <asp:Parameter Name="HST" Type="Double" />
                <asp:Parameter Name="Surcharge" Type="Double" />
                <asp:Parameter Name="NrOfPieces" Type="Int32" />
                <asp:Parameter Name="UserName" Type="String" />
                <asp:Parameter Name="StatusId" Type="Int32" />
                <asp:Parameter Name="ShipmentNumber" Type="Int32" />
            </UpdateParameters>
            <SelectParameters>
                <asp:SessionParameter Name="ReferenceNumber" SessionField="ReferenceNumber" Type="Int32" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="Shipmentdate" Type="DateTime" />
                <asp:Parameter Name="ClientId" Type="Int32" />
                <asp:Parameter Name="ClientBranchid" Type="Int32" />
                <asp:Parameter Name="CarrierId" Type="Int32" />
                <asp:Parameter Name="Weight" Type="Double" />
                <asp:Parameter Name="Origin" Type="Int32" />
                <asp:Parameter Name="OriginAddress" Type="String" />
                <asp:Parameter Name="OriginPostalCode" Type="String" />
                <asp:Parameter Name="Destination" Type="Int32" />
                <asp:Parameter Name="DestinationAddress" Type="String" />
                <asp:Parameter Name="DestinationPostalCode" Type="String" />
                <asp:Parameter Name="ServicetTypeId" Type="Int32" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="GST" Type="Double" />
                <asp:Parameter Name="PST" Type="Double" />
                <asp:Parameter Name="HST" Type="Double" />
                <asp:Parameter Name="Surcharge" Type="Double" />
                <asp:Parameter Name="TotalPieces" Type="Int32" />
                <asp:Parameter Name="UserName" Type="String" />
                <asp:Parameter Name="StatusId" Type="Int32" />
                <asp:Parameter Name="ShipmentNumber" Type="Int32" />
            </InsertParameters>
        </asp:ObjectDataSource>
    </p>
</asp:Content>

